namespace ``Concerning the coin change problem``

open System
open System.Linq
open FSpec
open FSpec.TestResources 

module ``A coin change solution`` =
    let ctx = new CoinChange()

module ``When Solving The Coin Change Problem`` = 
    open ``A coin change solution``
    
    let ``it return an empty string for zero amount``() =
        (ctx.getChangeFor 0).Length |> should.equal 0 
    
    let ``it return an empty string for negative amount``() =
        (ctx.getChangeFor -12).Length |> should.equal 0
    
    let ``the solution return correct change for 42``() =
        let expectedResult =
            (new Text.StringBuilder())
                .AppendLine("2 x 20c")
                .AppendLine("1 x 2c")
                .ToString()
        ctx.getChangeFor 42 |> should.equal expectedResult 
        
    let ``it return the correct change for 3347``() =
        let expectedResult = 
            (new Text.StringBuilder())
                .AppendLine("33 x 100c")
                .AppendLine("2 x 20c")
                .AppendLine("1 x 5c")
                .AppendLine("1 x 2c")
                .ToString() 
        ctx.getChangeFor 3347 |> should.equal expectedResult
        
    
    

    